<?php

namespace Home\Controller;
use Home\Core\VmsSDK;

class MediaGatewayController extends BaseController
{
    /**
     * 获取媒体网关列表
     */
    public function mediaGateway()
    {
        $param = I('get.');
        if(empty(I('get.pageid'))){
            $param['pageid']=1;
        }else{
            $param['pageid']=$_GET['pageid'];
        }
        $pageid=$param['pageid'];
        $param['pagesize'] = PAGE_SIZE;
        $sdk = new VmsSDK();
        $return = $this->http_request($sdk::getMediaGatewayList,$param,'GET');
        $array =  json_decode( json_encode( $return ), true );
        $pagesum=$return->pagesum;
        $this->assign('pageid',$pageid);
        $this->assign('array',$array);
        $this->assign('pagesum',$pagesum);
        $this->display();
    }
    /**
     * 添加媒体网关
     */
    public function addMediaGateway()
    {
        $param = I('post.');
        $sdk = new VmsSDK();
        $return = $this->http_request($sdk::addMediaGateway, $param, 'GET');
        $result = $return->result;//获取result的值
        $this->ajaxReturn($result);

    }
    /**
     * 修改媒体网关
     */
    public function modifyMediaGateway()
    {
        $param = I('post.');
        $sdk = new VmsSDK();
        $return = $this->http_request($sdk::modifyMediaGateway, $param, 'GET');
        $result = $return->result;//获取result的值
        $this->ajaxReturn($result);

    }
    /**
     * 删除媒体网关
     */
    public function delMediaGateway()
    {
        $param = I('post.');
        $sdk = new VmsSDK();
        $return = $this->http_request($sdk::delMediaGateway, $param, 'GET');
        $result = $return->result;//获取result的值
        $this->ajaxReturn($result);

    }


}